import java.io.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: fzykd
 * Date: 2022-11-10
 * Time: 21:21
 */

public class Demo4 {
    public static void main1(String[] args) {
        //按照字符来读
        try(Reader reader = new FileReader("e:/hade/demo.txt")){
            while (true){
                char[] buffer = new char[1024];
                int len = reader.read();
                if (len == -1){
                    break;
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        //按照字符来写
        try(Writer writer = new FileWriter("e:/hade/hello.txt")){
            writer.write("你好");
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
